// import { Configuration } from 'webpack';
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')

/**
 * @type {Configuration}
 */
const config = {
  entry: { // 支持字符串、数组、对象、函数
    'main': path.join(__dirname, '../src/main.js')
  },
  output: {
    path: path.join(__dirname, '../dist'),
    filename: '[name]-[chunkhash:6].js'
  },
  module: {
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'webpack-config',
      template: path.join(__dirname, '../src/index.html'),
      filename: 'index.html'
    }),
  ],
}

module.exports = config;